package com.quanyan.search.utils;

import org.apache.solr.client.solrj.impl.CloudSolrServer;

/**
 * SolrServerSingle
 *
 * @author Tu Chun
 * @date 2016/6/15
 */
public class SolrServerSingle {
    private static CloudSolrServer solrServer;
    private SolrServerSingle() {
    }
    public synchronized static CloudSolrServer getInstance(String url){
        if(solrServer==null)
            solrServer = new CloudSolrServer(url);
        return solrServer;
    }


   /* private static SolrServer solrServer;
    private SolrServerSingle() {
    }
    public synchronized static SolrServer getInstance(String url){
        if(solrServer==null)
            solrServer=new HttpSolrServer(url);
        return solrServer;
    }*/
}
